﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Drawing;

namespace GieldaCSharp
{
    class WykresRamka: Wykres
    {
        public WykresRamka(Border _b)
        {
            b = _b;
        }

        public override void Draw(PictureBox p, Graphics g, double maxY, double minY, int N)
        {
            Pen pioro_l = new Pen(Color.FromArgb(223, 223, 223), 1);
            Point pFrom = Point.Empty;
            Point pTo = Point.Empty;

            pFrom.X = b.minXn;
            pFrom.Y = b.minYn;
            pTo.X = b.maxXn;
            pTo.Y = b.minYn;

            g.DrawLine(pioro_l, pFrom, pTo);

            pFrom.X = b.minXn;
            pFrom.Y = b.minYn;
            pTo.X = b.minXn;
            pTo.Y = b.maxYn;

            g.DrawLine(pioro_l, pFrom, pTo);

            pFrom.X = b.minXn;
            pFrom.Y = b.maxYn;
            pTo.X = b.maxXn;
            pTo.Y = b.maxYn;

            g.DrawLine(pioro_l, pFrom, pTo);

            pFrom.X = b.maxXn;
            pFrom.Y = b.minYn;
            pTo.X = b.maxXn;
            pTo.Y = b.maxYn;

            g.DrawLine(pioro_l, pFrom, pTo);

            Rectangle rec = new Rectangle(b.minXn, b.minYn, b.maxXn - b.minXn, b.maxYn - b.minYn);
            g.FillRectangle(Brushes.White, rec);   
        }
    }
}
